#define  _CRT_SECURE_NO_WARNINGS 1

#include "MyQueue.h"

void TestStack()
{
	Stack St;
	StackInit(&St);
	StackPush(&St, 1);
	StackPush(&St, 2);
	StackPush(&St, 3);
	StackPush(&St, 4);
	StackPush(&St, 5);
	StackPush(&St, 6);

	printf("StackSize: %d\n", StackSize(&St));
	printf("StackTop: %d\n", StackTop(&St));

	while (!StackEmpty(&St))
	{
		printf("%d ", StackTop(&St));
		StackPop(&St);
	}
	printf("\n");

	printf("StackSize: %d\n", StackSize(&St));

	StackDestory(&St);

}

void TestMyQueue()
{
	MyQueue Qu;
	MyQueueInit(&Qu);

	MyQueuePush(&Qu, 1);
	MyQueuePush(&Qu, 2);
	MyQueuePush(&Qu, 3);
	MyQueuePush(&Qu, 4);
	MyQueuePush(&Qu, 5);
	MyQueuePush(&Qu, 6);

	printf("QueueFront: %d\n", MyQueueFront(&Qu));
	printf("QueueBack: %d\n", MyQueueBack(&Qu));
	printf("QueueSize: %d\n", MyQueueSize(&Qu));

	while (!MyQueueEmpty(&Qu))
	{
		printf("%d ", MyQueueFront(&Qu));
		MyQueuePop(&Qu);
	}
	printf("\n");


	printf("QueueSize: %d\n", MyQueueSize(&Qu));

	MyQueueDestory(&Qu);
}

int main()
{
	//TestStack();
	TestMyQueue();

	return 0;
}